<%@ page import="java.util.Date" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2025-11-10
  Time: 17:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>JSP基本语法</title>
</head>
<body>
    <%-- JSP表达式 --%>
    <%= new Date() %>

    <%
        int a = 10;
        for (int i = 0; i < 10; i++) {

    %>
    <!-- html注释风格 -->
    <h4>四级标题</h4>
    <%
            System.out.println(i);
        }
        String name = "Tom";
        System.out.println(name + " is a good boy" + a);
    %>

    <%!
        private int age = 10;  // 全局变量

        /**
         * 类方法
         */
        public void show() {
            /*
             *
             */
            System.out.println("show()方法");
        }

    %>
</body>
</html>
